<template>
    <el-button @click="login" type="primary" :loading="loading">登录</el-button>
</template>

<script setup>
import { ref } from 'vue'
const loading = ref(false);
const login = () => {
    loading.value = true;
    setTimeout(() => {
        loading.value = false;
    }, 3000);
    console.log('发送登录请求')
}
</script>

<style></style>